package cn.b.sky.user.service;

import cn.b.sky.user.model.Attachment;


/**
 * 
 * <strong>Title : AttachmentService.java<br></strong>
 * <strong>Package : cn.b.sky.use.service<br></strong>
 * <strong>Description : </strong>附件业务接口<br> 
 * <strong>Create on : 2015-11-5 下午01:58:05<br></strong>
 * <p>
 * @author dapeng.li<br>
 * @version <strong>v1.0.0</strong><br>
 * <br>
 * <strong>修改历史:</strong><br>
 * 修改人 | 修改日期 | 修改描述<br>
 * -------------------------------------------<br>
 * <br>
 * <br>
 */
public interface AttachmentService {
  /**
   * 
   * <strong>Title : selectAttachmentByHashCode<br></strong>
   * <strong>Description : </strong>根据MD5值查询附件<br> 
   * <strong>Create on : 2015-11-5 下午01:45:15<br></strong>
   * <p>
   * @param siteCode 工厂
   * @param hashCode MD5值
   * @return
   * Attachment
   * @throws 
   * @author dapeng.li<br>
   * @version <strong>v1.0.0</strong><br>
   * <br>
   * <strong>修改历史:</strong><br>
   * 修改人 | 修改日期 | 修改描述<br>
   * -------------------------------------------<br>
   * <br>
   * <br>
   */
  Attachment selectAttachmentByHashCode(String siteCode, String hashCode);

  /**
   * 
   * <strong>Title : selectAttachmentByAttachmentCode<br></strong>
   * <strong>Description : </strong>根据附件编号查询附件<br> 
   * <strong>Create on : 2015-11-5 下午01:46:45<br></strong>
   * <p>
   * @param siteCode
   * @param attachmentCode
   * @return
   * Attachment
   * @throws 
   * @author dapeng.li<br>
   * @version <strong>v1.0.0</strong><br>
   * <br>
   * <strong>修改历史:</strong><br>
   * 修改人 | 修改日期 | 修改描述<br>
   * -------------------------------------------<br>
   * <br>
   * <br>
   */
  Attachment selectAttachmentByAttachmentCode(String siteCode, String attachmentCode);

  /**
   * 
   * <strong>Title : updateAttachmentRefCount<br></strong>
   * <strong>Description : </strong>修改附件引用计数<br> 
   * <strong>Create on : 2015-11-5 下午01:47:40<br></strong>
   * <p>
   * @param attachment
   * void
   * @throws 
   * @author dapeng.li<br>
   * @version <strong>v1.0.0</strong><br>
   * <br>
   * <strong>修改历史:</strong><br>
   * 修改人 | 修改日期 | 修改描述<br>
   * -------------------------------------------<br>
   * <br>
   * <br>
   */
  void updateAttachmentRefCount(Attachment attachment);

  /**
   * 
   * <strong>Title : deleteAttachment<br></strong>
   * <strong>Description : </strong>删除附件<br> 
   * <strong>Create on : 2015-11-5 下午01:48:18<br></strong>
   * <p>
   * @param siteCode
   * @param attachmentCode
   * void
   * @throws 
   * @author dapeng.li<br>
   * @version <strong>v1.0.0</strong><br>
   * <br>
   * <strong>修改历史:</strong><br>
   * 修改人 | 修改日期 | 修改描述<br>
   * -------------------------------------------<br>
   * <br>
   * <br>
   */
  void deleteAttachment(String siteCode, String attachmentCode);

  /**
   * 
   * <strong>Title : insertAttachment<br></strong>
   * <strong>Description : </strong>新增附件<br> 
   * <strong>Create on : 2015-11-6 下午06:03:59<br></strong>
   * <p>
   * @param attachment
   * void
   * @throws 
   * @author dapeng.li<br>
   * @version <strong>v1.0.0</strong><br>
   * <br>
   * <strong>修改历史:</strong><br>
   * 修改人 | 修改日期 | 修改描述<br>
   * -------------------------------------------<br>
   * <br>
   * <br>
   */
  void insertAttachment(Attachment attachment);

  /**
   * 
   * <strong>Title : checkIsExtisAttachment<br></strong>
   * <strong>Description : </strong>上传的时候检验md5，相同文件校验，并给附件赋值attachmentCode，savePath，fileSize<br> 
   * <strong>Create on : 2016-7-21 下午4:18:03<br></strong>
   * <p>
   * @param attachMent
   * @param md5
   * @throws 
   * @author lidapeng<br>
   * @version <strong>v1.0.0</strong><br>
   * <br>
   * <strong>修改历史:</strong><br>
   * 修改人 | 修改日期 | 修改描述<br>
   * -------------------------------------------<br>
   * <br>
   * <br>
   */
  void checkIsExtisAttachment(Attachment attachMent, String md5);
}
